
class ioswitch
{
  public static void main(String[] args){
    try {
      int pin, onoff;
      pin = Integer.parseInt(args[0]);
      onoff = Integer.parseInt(args[1]);
    
      System.out.println(args[0]);
      // load the shared library 
      System.loadLibrary("octopus");

      octopus_context octo = new octopus_context();
      octopus.octopus_init(octo);
      octopus.octopus_open(octo);

      if(pin > 0 && pin < 45)
      {
	octopus.octopus_io_init(octo,pin);
	octopus.octopus_io_set_pin_direction_out(octo,pin);

	octopus.octopus_io_set_pin(octo,pin,onoff);
      }
    } catch (Exception e) {
      e.toString();
    }
  }
}

